const awaitWrap = (promise: Promise<any>, errMsg?: string) => {
    return promise
        .then(data => [null, data])
        .catch(err => {
            return [err, null];
        });
};

export default awaitWrap;
